<?php
class Myblog_Form_CategoryEdit extends Zend_Form
{
public $formDecorators=array(
array('FormElements'),
array('Form'),
);
public $elementDecorators=array(
array('ViewHelper'),
array('Label'),
array('Errors'),
array('HtmlTag',array('dd'=>'p','dt'=>'p')),
);
public $buttonDecorators=array(
array('ViewHelper'),
array('HtmlTag',array('dd'=>'p'))
);
	public function init()
	{
	$this->setAction('/admin/category/edit')
		->setAttrib('class', 'edit')
		->setMethod('post')
		->setDecorators($this->formDecorators);



$category_name=new Zend_Form_Element_Text('category_name');
$category_name->setLabel('Изменить название категории:')
		->setOptions(array('size'=>'15','class'=>'edit'))
		->setRequired(false)
		->addFilter('HtmlEntities')
		->addFilter('StringTrim')
		->addFilter('StringToLower')
		->setDecorators($this->elementDecorators);

$category_id=new Zend_Form_Element_Hidden('category_id');
$category_id->setLabel('')
		->setOptions(array('size'=>'4'))
		->addValidator('Int')
		->setRequired(false)
		->addFilter('HtmlEntities')
		->addFilter('StringTrim');

$submit=new Zend_Form_Element_Submit('submit');
$submit->setLabel('Сохранить')
	->setOptions(array('class'=>'submit2'))
	->setDecorators($this->buttonDecorators);

	$this->addElements(array($category_name,$category_id,$submit));
	}
}
